<%@ page language="java" contentType="text/html; charset=UTF-8"	isELIgnored="false" pageEncoding="UTF-8"%>
<%@page import="java.util.List"%>
<%@page import="java.util.Map"%>
<%@page import="com.hongye.app.model.ReturnGoodsModel"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
 <% ReturnGoodsModel rgm =(ReturnGoodsModel)request.getAttribute("returngoods"); %>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->

		<link href="css/bootstrap.min.css" rel="stylesheet">
		<link href="css/site.css" rel="stylesheet">
		<link href="css/default.css" rel="stylesheet">
		<script src="js/jquery.min2.js"></script>
		<script src="js/bootstrap.min2.js"></script>

		<link rel="stylesheet" href="http://cdn.amazeui.org/amazeui/2.5.0/css/amazeui.min.css" />
		<title>退货进程</title>
		<style>
	    </style>
	</head>

	<body style=" background-color: #e0dada;">
		<%List list=(List)request.getAttribute("traces");%>
			<%for(int i=1;i<=list.size();i++){
				Map map = (Map)list.get(i-1);
					%>
					
					<%Object state=map.get("state"); int agei = Integer.parseInt(state.toString());if(agei == 0){%>
						<div class="container" style=" background-color: #e0dada;">
							<div id="position-3-info" class="mt-sm mb-sm btn btn-info">
								<%=map.get("updateTime") %>
							</div><br>
							<div class="df"><img src="img/zuo-2.png" style="vertical-align:top;"></div>
							<div class="well info">
							<h5><%=map.get("title") %></h5>
							<HR style="border:3 dashed #e0dada" width="99%" color=#e0dada SIZE=1>
								<p>订单状态：商家已发货；退款金额：${returngoods.return_money}元;退货原因：${returngoods.return_reason}</p>
								<ul data-am-widget="gallery" class="am-gallery am-avg-sm-2 am-avg-md-3 am-avg-lg-4 am-gallery-overlay" data-am-gallery="{ pureview: true }">
									<li style="width:100%;">
										<div class="am-gallery-item">
											<%String thumb1 = rgm.get("thumb1"); if(thumb1 != null){%>
												<a class="" style="display:block; width30%; padding-right:3%; float:left;"><img src="../upload/${returngoods.thumb1}" /></a>
											<%}%>
											<%String thumb2 = rgm.get("thumb2"); if(thumb2 != null){%>
												<a class="" style="display:block; width30%; padding-right:3%; float:left;"><img src="../upload/${returngoods.thumb2}" /></a>
											<%}%>
											<%String thumb3 = rgm.get("thumb3"); if(thumb3 != null){%>
												<a class="" style="display:block; width30%; padding-right:3%; float:left;"><img src="../upload/${returngoods.thumb3}" /></a>
											<%}%>
										</div>
									</li>
								</ul>
							</div>
						</div>
					<%}else if(agei == -1){%>
						<div class="container" style=" background-color: #e0dada;">
							<div id="position-3-info" class="mt-sm mb-sm btn btn-info">
								<%=map.get("updateTime") %>
							</div>
							<p><%=map.get("name") %></p>
							<div class="df1"><img src="img/you-3.png" style="vertical-align:top;"></div>
							<div class="well info" style="background-color:#fe7733 ;">
								<h5><%=map.get("title") %></h5>
								<HR style="border:3 dashed #e0dada" width="99%" color=#e0dada SIZE=1>
								<p style="color: #E6F7FF;">如果商家同意，会将收货地址发给您，需要您退货给商家<br>如果商家在<span>三</span>天内未处理，退货申请将自动达成</p>
								<HR style="border:3 dashed #e0dada" width="99%" color=#e0dada SIZE=1>
							</div>
						</div>
						<%int rstatus = rgm.getInt("return_status"); if(rstatus == 0){%>
							<div class="container" style=" background-color: #e0dada;">
								<HR style="border:3 dashed #b2b2b2; height:1px" width="99%" color=#b2b2b2 SIZE=1>
								<a onclick="agreeApply(this);" data-id="${returngoods.return_id}" class="btn btn-default btn-lg active" role="button" style=" float: right; margin-right: 3rem; margin-bottom: 3rem;">同意退货</a>
							</div>
						<%} %>
					<%}else if(agei == 3){%>
						<div class="container" style=" background-color: #e0dada;">
							<div id="position-3-info" class="mt-sm mb-sm btn btn-info">
								<%=map.get("updateTime") %>
							</div><br>
							<div class="df"><img src="img/zuo-2.png" style="vertical-align:top;"></div>
							<div class="well info">
							<h5><%=map.get("title") %></h5>
							<HR style="border:3 dashed #e0dada" width="99%" color=#e0dada SIZE=1>
								<p>买家已取消了退货申请</p>
							</div>
						</div>
					<%}else if(agei == -2){%>
						<div class="container" style=" background-color: #e0dada;">
							<div id="position-3-info" class="mt-sm mb-sm btn btn-info">
								<%=map.get("updateTime") %>
							</div>
							<p><%=map.get("name") %></p>
							<div class="df1"><img src="img/you-3.png" style="vertical-align:top;"></div>
							<div class="well info" style="background-color:#fe7733 ;">
								<h5><%=map.get("title") %></h5>
								<HR style="border:3 dashed #e0dada" width="99%" color=#e0dada SIZE=1>
								<p style="color: #E6F7FF;">买家取消了退货申请，交易继续</p>
								<HR style="border:3 dashed #e0dada" width="99%" color=#e0dada SIZE=1>
							</div>
						</div>
					<%}else if(agei == 2){%>
						<div class="container" style=" background-color: #e0dada;">
							<div id="position-3-info" class="mt-sm mb-sm btn btn-info">
								2016.3.30 11:11:11
							</div>
							<p><%=map.get("name") %></p>
							<div class="df1"><img src="img/you.png" style="vertical-align:top;"></div>
							<div class="well info" style="background-color:#51a3cb ;">
								<h5><%=map.get("title") %></h5>
								<HR style="border:3 dashed #e0dada" width="99%" color=#e0dada SIZE=1>
								<p style="color: #E6F7FF;">商家已经同意了本次退货申请</p>
							</div>
						</div>
					<%}else if(agei == -3){%>
						<div class="container" style=" background-color: #e0dada;">
							<div id="position-3-info" class="mt-sm mb-sm btn btn-info">
								<%=map.get("updateTime") %>
							</div>
							<p><%=map.get("name") %></p>
							<div class="df1"><img src="img/you-3.png" style="vertical-align:top;"></div>
							<div class="well info" style="background-color:#fe7733 ;">
								<h5><%=map.get("title") %></h5>
								<HR style="border:3 dashed #e0dada" width="99%" color=#e0dada SIZE=1>
								<p style="color: #E6F7FF;">商家已将同意了本次退货申请。<br>
														      如还未收到收到货物，请在收到货物时选择拒收；<br>
														      如已收到货物请将货物，请在及时将货物发给商家。<br>
														      未经商家同意，请不要使用到付或平邮<br>
														      退货完成后请点击“退货”填写物流信息 </p>
								<HR style="border:3 dashed #e0dada" width="99%" color=#e0dada SIZE=1>
							</div>
						</div>
					<%}else if(agei == 4){%>
						<div class="container" style=" background-color: #e0dada;">
							<div id="position-3-info" class="mt-sm mb-sm btn btn-info">
								<%=map.get("updateTime") %>
							</div><br>
							<div class="df"><img src="img/zuo-2.png" style="vertical-align:top;"></div>
							<div class="well info">
								<h5><%=map.get("title") %></h5>
								<HR style="border:3 dashed #e0dada" width="99%" color=#e0dada SIZE=1>
								<p>物流公司：${returngoods.express}<br>物流单号：${returngoods.waybillnumber}<br>
									<a href="#" onclick="viewLogistics(this);" data-waybillnumber="${returngoods.waybillnumber}" data-express="${returngoods.express}" class="btn btn-default btn-lg active" role="button" style=" color:#fe7733; border-color:#fe7733; margin-left: 6.5rem;" >查看物流</a>
								</p>
							</div>
						</div>
					<%}else if(agei == -4){%>
						<div class="container" style=" background-color: #e0dada;">
							<div id="position-3-info" class="mt-sm mb-sm btn btn-info">
								<%=map.get("updateTime") %>
							</div>
							<p><%=map.get("name") %></p>
							<div class="df1"><img src="img/you-3.png" style="vertical-align:top;"></div>
							<div class="well info" style="background-color:#fe7733 ;">
								<h5><%=map.get("title") %></h5>
								<HR style="border:3 dashed #e0dada" width="99%" color=#e0dada SIZE=1>
								<p>
									<a href="#" onclick="viewLogistics(this);" data-waybillnumber="${returngoods.waybillnumber}" data-express="${returngoods.express}" class="btn btn-default btn-lg active" role="button" style=" color:#fe7733; border-color:#fe7733; margin-left: 6.5rem;">查看物流</a>
								</p>
							</div>
						</div>
						<%int rstatus = rgm.getInt("return_status"); if(rstatus == 4){%>
							<div class="container" style=" background-color: #e0dada;">
								<HR style="border:3 dashed #b2b2b2; height:1px" width="99%" color=#b2b2b2 SIZE=1>
								<a onclick="confirm(this);" data-id="${returngoods.return_id}" class="btn btn-default btn-lg active" role="button" style=" float: right; margin-right: 3rem; margin-bottom: 3rem;">确认收货</a>
							</div>
						<%} %>
					<%}else if(agei == 7){%>
						<div class="container" style=" background-color: #e0dada;">
							<div id="position-3-info" class="mt-sm mb-sm btn btn-info">
								2016.3.30 11:11:11
							</div>
							<p><%=map.get("name") %></p>
							<div class="df1"><img src="img/you.png" style="vertical-align:top;"></div>
							<div class="well info" style="background-color:#51a3cb ;">
								<h5><%=map.get("title") %></h5>
								<HR style="border:3 dashed #e0dada" width="99%" color=#e0dada SIZE=1>
								<p style="color: #E6F7FF;">商家已确认收货</p>
							</div>
						</div>
					<%}else if(agei == -5){%>
						<div class="container" style=" background-color: #e0dada;">
							<div id="position-3-info" class="mt-sm mb-sm btn btn-info">
								<%=map.get("updateTime") %>
							</div>
							<p><%=map.get("name") %></p>
							<div class="df1"><img src="img/you-3.png" style="vertical-align:top;"></div>
							<div class="well info" style="background-color:#fe7733 ;">
								<h5><%=map.get("title") %></h5>
								<HR style="border:3 dashed #e0dada" width="99%" color=#e0dada SIZE=1>
								<p style="color: #E6F7FF;">商家已确认收货，退货已完成 </p>
								<HR style="border:3 dashed #e0dada" width="99%" color=#e0dada SIZE=1>
							</div>
						</div>
					<%}else if(agei == -6){%>
						<div class="container" style=" background-color: #e0dada;">
							<div id="position-3-info" class="mt-sm mb-sm btn btn-info">
								<%=map.get("updateTime") %>
							</div>
							<p><%=map.get("name") %></p>
							<div class="df1"><img src="img/you-3.png" style="vertical-align:top;"></div>
							<div class="well info" style="background-color:#fe7733 ;">
								<h5><%=map.get("title") %></h5>
								<HR style="border:3 dashed #e0dada" width="99%" color=#e0dada SIZE=1>
								<p style="color: #E6F7FF;"> 订单金额已退回</p>
								<HR style="border:3 dashed #e0dada" width="99%" color=#e0dada SIZE=1>
							</div>
						</div>
					<%} %>
				<%} %>
		
		<script src="js/amazeui.js"></script>
		<script type="text/javascript">
			function agreeApply(obj){
				var id = obj.getAttribute("data-id");
				this.location.href = '../returngoods/agreeApply?id=' +id;
			}
			
			function confirm(obj){
				var id = obj.getAttribute("data-id");
				this.location.href = '../returngoods/confirm?id=' +id;
			}
			
			function viewLogistics(obj){
				var waybillnumber = obj.getAttribute("data-waybillnumber");
				var express = obj.getAttribute("data-express");
				this.location.href = '../returngoods/viewLogistics?express=' +express +'&waybillnumber=' + waybillnumber;
			}
			
		</script>
	</body>

</html>